package com.myjar.excel.v2;

import java.io.InputStream;

public class POiWorkSpace<T> extends WorkSpace<T> {
    public POiWorkSpace(Class<?> tclass) throws Exception {
        super(tclass);
    }

    @Override
    protected void prepareRead(InputStream inputStream) {
        workbook = new POiWorkbook(inputStream);
    }

    @Override
    protected void prepareWrite() {
        workbook = new POiWorkbook(beanInfo.getType());
    }

    @Override
    protected void initReadContext() throws ExcelException {
        context = new POiContext<>(workbook);
    }

    @Override
    protected void initWriteContext() {
        context = new POiContext<>(workbook, beanInfo.getSheetName());
    }


}
